/**
 * Handle changed data.
 *
 * @param {Object} oldValue old value
 * @param {Object} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"C8F7C63E-64E4-4CBC-95DB-A0914BBCC194"}
 */
function onDataChange_tipo(oldValue, newValue, event) 
{
	if(cuentas_tipo == 1) // es banco
		caja_abierta = 1; 
	else
		caja_abierta = 0;
	return true
}



/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @properties={typeid:24,uuid:"591535AA-314C-4964-B6BA-D2CF06A109A0"}
 */
function onRenderAbierta(event) {
	/** @type {JSRecord<db:/infocom/cuentas_cyb>}*/
	var $rcd = event.getRecord()
	if ($rcd.cuentas_tipo == 0)
	{
		event.getRenderable().enabled = false
	}
	else
	{
		event.getRenderable().enabled = true
	}
}



/**
 * Called before the form component is rendered.
 *
 * @param {JSRenderEvent} event the render event
 *
 * @properties={typeid:24,uuid:"7B38E973-CD50-4498-BD22-C3B331C5AB8C"}
 */
function onRenderCtaValDifer(event) {
	/** @type {JSRecord<db:/infocom/cuentas_cyb>}*/
	var $rcd = event.getRecord()
	if ($rcd.cuentas_tipo != 1)
	{
		event.getRenderable().enabled = false
	}
	else
	{
		event.getRenderable().enabled = true
	}
}
